
var initSystem = function(btnObj){
	$.ajax({
		url: MAIN_REST_URL + "admin/init/all",
		dataType: 'json',
		beforeSend: function(){
			$('#'+btnObj.id).prop("disabled", true);
			$('#'+btnObj.id).css("cursor",  "wait");
			$(document).css("cursor",  "wait");
			
			$("#initLogOutput").html("initalizing System ... ");
        },
        success: function(response) {
        	$("#initLogOutput").html("System is successfully initialized.");
        	$("#initLogOutput").css("color", "green");
        },
        error: function(response) {
        	$("#initLogOutput").html("Failed to initialize System.");
        	$("#initLogOutput").css("color", "red");
        	
        },        
        complete: function(){
        	$('#'+btnObj.id).css("cursor",  "default");
        	$(document).css("cursor",  "default");
        	
        },	        
		context: document.body
		});			
};

